<?php

/**
 * Demó page oldalak.
 *
 * @author Zsolt Lengyel
 *
 */
class m130213_230000_pages extends CDbMigration{

    public function up(){

        Yii::import('application.models.*');

        // add demo pages
        $s1 = new Page();
        $s1->title = 'Főoldal';
        $s1->description = 'Főoldal';
        $s1->content = '<p> Telefon:  36 20/565 6555 </p>';
        $s1->controller = 'site/index';
        $s1->active = 1;
        $s1->save();

        $s2 = new Page();
        $s2->title = 'Login';
        $s2->description = 'Login';
        $s2->controller = 'site/login';
        $s2->active = 1;
        $s2->parent = $s1;
        $s2->save();

        $s3 = new Page();
        $s3->title = 'Kapcsolat';
        $s3->description = 'Kapcsolat';
        $s3->content = '<p> Telefon:  36 20/565 6555 </p>';
        $s3->active = 1;
        $s3->save();

        $s4 = new Page();
        $s4->title = 'Inaktív';
        $s4->description = 'Inaktív';
        $s4->content = '<p> Telefon:  36 20/565 6555 </p>';
        $s4->active = 0;
        $s4->parent = $s3;
        $s4->save();



    }


    public function down(){

        $this->truncateTable('page');

    }


}